<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.springframework.org/schema/data/jaxb">


<div class="layui-layout layui-layout-admin">
    <input type="hidden"  th:value="${id}" id="id">
        <!-- 内容主体区域 -->
        <div style="padding: 15px;">

            <div class="layui-row">
                <table class="layui-hide" id="field_table" ></table>
            </div>
        </div>
</div>
<script th:src="@{/layui/layui.all.js}"></script>
<script th:inline="javascript" >

    var  fieldTableUrl=/*[[@{/getField}]]*/

   var  field_tableIns = table.render({
        elem: '#field_table',
        url: fieldTableUrl,
        where:{
            id:$("#id").val()
        },
        method:'post',
        limit:30,
        cols: [
            [
                {field:'fieldName', width:130, title: '字段名'},
                {field:'fieldRemark', width:130, title: '字段备注'},
                {field:'isPrimary', width:130, title: '是否主键'
                    ,templet: function(d){
                        var isPrimary=d.isPrimary
                        if(isPrimary==1){
                            return '是'
                        }else {
                            return '否'
                        }
                    }},
                {field:'isNull', width:130, title: '是否允许为空'
                    ,templet: function(d) {
                        var isNull = d.isNull
                        if (isNull == 1) {
                            return '是'
                        } else {
                            return '否'
                        }
                    }},
                {field:'fieldType', width:130, title: '字段属性'},
                {field:'classFieldName', width:130, title: '生成字段名称'},
                {field:'isTable', width:130, title: '是否列表显示'
                    ,templet: function(d){
                        var isTable=d.isTable
                        if(isTable==1){
                            return '是'
                        }else {
                            return '否'
                        }
                  }},
                {field:'isForm', width:130, title: '是否新增修改界面显示'
                    ,templet: function(d){
                        var isForm=d.isForm
                        if(isForm==1){
                            return '是'
                        }else {
                            return '否'
                        }
                    }},
                {field:'isSort', width:130, title: '是否需要排序'
                    ,templet: function(d){
                        var isSort=d.isSort
                        if(isSort=1){
                            return '是'
                        }else {
                            return '否'
                        }
                    }},
                {field:'formAway', width:130, title: '表单界面呈现方式'
                    ,templet: function(d){
                        var formAway=d.formAway
                        switch(formAway){
                            case 0: return '不输入'
                            case 1: return '文字框创建'
                            case 2: return '密码框输入'
                            case 3: return '数字框输入'
                            case 4: return '日期输入框输'
                            case 5: return '日期时间输入框输入'
                            case 6: return '单选下拉列表输入'
                            case 7: return '多选下拉框输入'
                            case 8: return '文本域输入'
                            case 9: return '图片输入'
                            case 10: return '图片组输入'
                            case 11: return '上传输入'
                            default: return ''
                        }

                    }},
                {field:'isSearch', width:130, title: '是否需要查询'
                    ,templet: function(d){
                        var isSearch=d.isSearch
                        if(isSearch=1){
                            return '是'
                        }else {
                            return '否'
                        }
                    }},
                {field:'searchWay', width:130, title: '查询方式'
                    ,templet: function(d){
                        var searchWay=d.searchWay
                        switch(searchWay){
                            case 1: return '等于'
                            case 2: return '模糊匹配'
                            case 3: return '小于'
                            case 4: return '大于'
                            case 5: return '小于等于'
                            case 6: return '大于等于'
                            case 7: return '包含（闭区间）'
                            case 8: return '包含（开区间）'
                            default: return ''
                        }
                    }},
                {field:'isView', width:130, title: '是否显示详情页上'
                    ,templet: function(d){
                        var isView=d.isView
                        if(isView==1){
                            return '是'
                        }else {
                            return '否'
                        }
                    }},
                {field:'id', width:130, title: '操作' ,templet: '#toUpdateField',fixed:'right'}
            ]
        ],
    });

   var  filed_table_index="";

    function toUpdateField(id){
        var tableUrl = /*[[@{/field/toUpdate}]]*/
            $.post(tableUrl, {'id':id}, function(id){
                filed_table_index= layer.open({
                    type: 1,
                    area: ['80%', '80%'],
                    content: id //注意，如果str是object，那么需要字符拼接。
                });
            });
    }


</script>
</html>